ComponentOne Data Source for Entity Framework
C1.WPF.LiveLinq Namespace / WpfExtensions Class / ToIndexed Method / ToIndexed<T>(INotifyCollectionChanged) Method
The type of the elements in the collection.
An System.Collections.Specialized.INotifyCollectionChanged data source to represent as an C1.LiveLinq.Collections.IndexedCollection<T>.

In This Topic
    ToIndexed<T>(INotifyCollectionChanged) Method
    In This Topic
    Creates an C1.LiveLinq.Collections.IndexedCollection<T> based on the specified System.Collections.Specialized.INotifyCollectionChanged data source.
    Syntax
    'Declaration
     
    
    Public Overloads Shared Function ToIndexed(Of T)( _
       ByVal source As System.Collections.Specialized.INotifyCollectionChanged _
    ) As IndexedCollection(Of T)
    public static IndexedCollection<T> ToIndexed<T>( 
       System.Collections.Specialized.INotifyCollectionChanged source
    )

    Parameters

    source
    An System.Collections.Specialized.INotifyCollectionChanged data source to represent as an C1.LiveLinq.Collections.IndexedCollection<T>.

    Type Parameters

    T
    The type of the elements in the collection.

    Return Value

    An C1.LiveLinq.Collections.IndexedCollection<T> that contains the same elements as the System.Collections.Specialized.INotifyCollectionChanged and enables indexing of that data source.
    Remarks

    Use this method to index and query your existing data sources implementing System.Collections.Specialized.INotifyCollectionChanged. The element type of this data source must implement System.ComponentModel.INotifyPropertyChanged, see Using the built-in collection class IndexedCollection(T) (LiveLinq to Objects)|tag=Using_the_built_in_collection_class_IndexedCollectionT_LiveLinq_to_Objects.

    The collection returned by this method also implements the System.Collections.Specialized.INotifyCollectionChanged interface, because this method actually returns objects of an internal derived class that implements that interface.

    Note: Indexes created on the resulting C1.LiveLinq.Collections.IndexedCollection<T> are owned by it and not by the original data source. Every ToIndexed() call creates a separate object that has its own separate indexes. Avoid calling ToIndexed() repeatedly for the same collection because it can increase the cost of maintaining indexes.

    See Also